﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="RegStep.ascx.cs" Inherits="UserControl_RegStep" %>
<fieldset>
    <legend><img src="Images/regtext.gif" /></legend>
    <asp:CreateUserWizard ID="CreateUserWizard1" runat="server" Width="550px" CancelDestinationPageUrl="Login.aspx" ContinueDestinationPageUrl="Default.aspx" DuplicateUserNameErrorMessage="该用户名已被注册！请另输入一个用户名。" DisplayCancelButton="True" FinishCompleteButtonType="Image" FinishDestinationPageUrl="Default.aspx">
        <WizardSteps>
            <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server">
                <ContentTemplate>
                    <table border="0">
                        <tr>
                            <td align="center" colspan="3" style="color: red; font-weight:bold; font-size:12pt; padding:2px; border:solid 1px red;">
                                <asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal>
                            </td>
                        </tr>
                        <tr>
                            <td align="left" colspan="3" style="height: 55px">
                                <h3><img src="Images/mcenter_arrow.gif" />
                                    选择登录用户名</h3>
                                <span class="attention">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;请使用英文(A-Z ,a-z)和数字(0-9)及下划线( _ )填写!</span>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" style="width: 90px; height: 26px">
                                <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">用户名:</asp:Label></td>
                            <td align="left" style="width: 220px; height: 26px;">
                                <asp:TextBox ID="UserName" runat="server" Width="150px"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
                                    ErrorMessage="必须填写“用户名”。" ToolTip="必须填写“用户名”。" ValidationGroup="CreateUserWizard1" Display="Dynamic">不能为空!</asp:RequiredFieldValidator>
                                </td>                               
                            <td align="left" style="width: 225px; height: 26px">
                                <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                                    <ContentTemplate>
<asp:Button id="UserNameTest" onclick="UserNameTest_Click" runat="server" Text="检测用户名"></asp:Button>&nbsp; <asp:Label id="Msg" runat="server" Width="110px"></asp:Label> 
</ContentTemplate>
                                    <Triggers>
<asp:AsyncPostBackTrigger ControlID="UserNameTest" EventName="Click"></asp:AsyncPostBackTrigger>
</Triggers> 
                                </asp:UpdatePanel>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="3" style="height: 20px"><hr /></td>
                        </tr>
                        <tr>
                            <td align="left" colspan="3">
                                <h3><img src="Images/mcenter_arrow.gif" />
                                    填写安全信息</h3>
                                <span class="attention">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6-16个字符,区分英文大小写!</span>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" style="width: 90px">
                                <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">密码:</asp:Label></td>
                            <td align="left" style="width: 220px">
                                <asp:TextBox ID="Password" runat="server" TextMode="Password" Width="150px" MaxLength="16"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
                                    ErrorMessage="必须填写“密码”。" ToolTip="必须填写“密码”。" ValidationGroup="CreateUserWizard1" Display="Dynamic">不能为空!</asp:RequiredFieldValidator>                                    
                            </td>
                            <td style="width: 225px">
                                <asp:RegularExpressionValidator ID="PasswordRegular" runat="server" ErrorMessage="密码必须为6-16位!" ValidationExpression="^.{6,16}$" ControlToValidate="Password" ValidationGroup="CreateUserWizard1">
                                </asp:RegularExpressionValidator>&nbsp;</td>
                        </tr>
                        <tr>
                            <td align="right" style="width: 90px; height: 27px;">
                                <asp:Label ID="ConfirmPasswordLabel" runat="server" AssociatedControlID="ConfirmPassword">确认密码:</asp:Label></td>
                            <td align="left" style="height: 27px; width: 220px;">
                                <asp:TextBox ID="ConfirmPassword" runat="server" TextMode="Password" Width="150px" MaxLength="16"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server" ControlToValidate="ConfirmPassword"
                                    ErrorMessage="必须填写“确认密码”。" ToolTip="必须填写“确认密码”。" ValidationGroup="CreateUserWizard1" Display="Dynamic">不能为空!</asp:RequiredFieldValidator>
                            </td>
                            <td style="width: 225px">
                                <asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password"
                                        ControlToValidate="ConfirmPassword" Display="Dynamic" ErrorMessage="“密码”和“确认密码”必须匹配。"
                                        ValidationGroup="CreateUserWizard1"></asp:CompareValidator>&nbsp;
                            </td> `
                        </tr>
                        <tr>
                            <td align="right" style="width: 90px; height: 26px;">
                                <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">电子邮件:</asp:Label></td>
                            <td align="left" colspan="2" style="height: 26px">
                                <asp:TextBox ID="Email" runat="server" Width="200px"></asp:TextBox><asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="Email"
                                    ErrorMessage="必须填写“电子邮件”。" ToolTip="必须填写“电子邮件”。" ValidationGroup="CreateUserWizard1" Display="Dynamic">不能为空!</asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" style="width: 90px; height: 26px;">
                                <asp:Label ID="QuestionLabel" runat="server" AssociatedControlID="Question">安全提示问题:</asp:Label></td>
                            <td align="left" colspan="2" style="height: 26px">
                                <asp:TextBox ID="Question" runat="server" Width="200px"></asp:TextBox><asp:RequiredFieldValidator ID="QuestionRequired" runat="server" ControlToValidate="Question"
                                    ErrorMessage="必须填写“安全提示问题”。" ToolTip="必须填写“安全提示问题”。" ValidationGroup="CreateUserWizard1" Display="Dynamic">不能为空!</asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" style="width: 90px; height: 26px;">
                                <asp:Label ID="AnswerLabel" runat="server" AssociatedControlID="Answer">安全答案:</asp:Label></td>
                            <td align="left" colspan="2" style="height: 26px">
                                <asp:TextBox ID="Answer" runat="server" Width="200px"></asp:TextBox><asp:RequiredFieldValidator ID="AnswerRequired" runat="server" ControlToValidate="Answer"
                                    ErrorMessage="必须填写“安全答案”。" ToolTip="必须填写“安全答案”。" ValidationGroup="CreateUserWizard1" Display="Dynamic">不能为空!</asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="3" style="height: 20px"><hr /></td>
                        </tr>                           
                        <tr>
                            <td align="left" colspan="3" style="height: 20px">
                                <h3><img src="Images/mcenter_arrow.gif" />
                                填写员工信息</h3>
                                <span class="attention"> &nbsp; &nbsp;请填写您的员工真实信息,以便验证您的身份</span></td>
                        </tr>
                        <tr>
                            <td align="right">
                                <asp:Label ID="EmpIDLabel" runat="server" AssociatedControlID="EmpID">员工号:</asp:Label>
                            </td>
                            <td align="left" style="width: 220px">
                                <asp:TextBox ID="EmpID" runat="server" Width="150px"></asp:TextBox><asp:RequiredFieldValidator ID="EmpIDRequired" runat="server" ControlToValidate="EmpID"
                                    ErrorMessage="必须填写“员工号”。" ToolTip="必须填写“员工号”。" ValidationGroup="CreateUserWizard1" Display="Dynamic">不能为空!</asp:RequiredFieldValidator>
                            </td>
                            <td align="left" style="width: 225px">                                    
                                <asp:CustomValidator ID="NoThisEmpID" runat="server" ErrorMessage="此员工号不存在!"></asp:CustomValidator>                                
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <asp:Label ID="EmpNameLabel" runat="server" AssociatedControlID="EmpName">员工姓名:</asp:Label>
                            </td>
                            <td align="left" style="width: 220px">
                                <asp:TextBox ID="EmpName" runat="server" Width="150px"></asp:TextBox><asp:RequiredFieldValidator ID="EmpNameRequired" runat="server" ControlToValidate="EmpName"
                                    ErrorMessage="必须填写“员工姓名”。" ToolTip="必须填写“员工姓名”。" ValidationGroup="CreateUserWizard1" Display="Dynamic">不能为空!</asp:RequiredFieldValidator>
                            </td>
                            <td align="left" style="width: 225px">                                    
                                <asp:CustomValidator ID="IDNotMatchName" runat="server" ErrorMessage="员工号与员工姓名不匹配!"></asp:CustomValidator>                                
                            </td>
                        </tr>
                        <tr>
                            <td colspan="3" style="height: 20px">
                            　<hr />
                            </td>
                        </tr>                            
                    </table>
                </ContentTemplate>
                <CustomNavigationTemplate>
                    <table border="0" cellspacing="0" style="width: 100%; height: 100%">
                        <tr align="right">
                            <td align="center" style="width: 50%; height: 100%">
                                <asp:Button ID="StepNextButton" runat="server" CommandName="MoveNext" Text="创建用户"
                                    ValidationGroup="CreateUserWizard1" />
                            </td>
                            <td align="left" style="width: 50%; height: 100%">                                
                                <asp:Button ID="ButtonCancel" runat="server" CommandName="Cancel" Text="取消"
                                    OnClick="ButtonCancel_Click" />
                            </td>
                        </tr>
                    </table>
                </CustomNavigationTemplate>
            </asp:CreateUserWizardStep>
            <asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server">
                <ContentTemplate>
                    <h3>已成功提交用户注册信息!</h3>
                    <p>系统将发送<span class="attention">确认邮件</span>到您预留的邮箱</p>
                    <p>请点击该邮件中的<span class="attention">激活链接</span>以激活您的账号</p>
                    <br />
                    <p>您预留的邮箱地址为:</p>
                </ContentTemplate>
                <CustomNavigationTemplate>
                    <table border="0" cellspacing="10" style="width: 100%; height: 100%">
                        <tr align="right">
                            <td align="center" colspan="0">
                                <asp:Button ID="ButtonComfirm" runat="server" Text="确认" Width="100px" CommandName="Finish" />
                            </td>
                        </tr>
                    </table>
                </CustomNavigationTemplate>
            </asp:CompleteWizardStep>
        </WizardSteps>
    </asp:CreateUserWizard>
</fieldset>